home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1988 January & February / rerun-1988-01-02.d64 / calendar maker (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  83 lines

  1. 10 rem calendar maker
  2. 20 rem by: bob kodadek
  3. 30 rem 3164 surrey lane
  4. 40 rem aston, pa 19014
  5. 50 :
  6. 60 dim mo$(12),nd(12),mm(50),xm$(50,5):u$=chr$(221)
  7. 70 for i=1to12:read mo$(i),nd(i):next
  8. 80 for i=0to6:read d$:dy$=dy$+d$+"  ":pd$=pd$+d$+"   ":next
  9. 90 for i=0to9:s$=s$+" ":next:for i=0to77:h$=h$+chr$(45):next
  10. 100 us$=u$+s$:print"[147]run - calendar maker":print:gosub 590
  11. 110 gosub 690
  12. 120 gosub 330:k=val(a$):if k<1 or k>5 then 120
  13. 130 if k=4 then print"[147]one moment...":run
  14. 140 if k=5 then end
  15. 150 on k gosub 180,380,430:goto110
  16. 160 :
  17. 170 rem ----- edit memos -----
  18. 180 gosub 300
  19. 190 print"[147]memos for "mo$(mo)dt
  20. 200 print"   >----------<  10 characters each":gosub 270
  21. 210 print"[145][145][145][145][145][145][145]":for i=0to5:input"";x$:x$=left$(x$,10)
  22. 220 if len(x$) <10 then x$=x$+chr$(32):goto 220
  23. 230 xm$(dt+j,i)=x$:next:print
  24. 240 gosub 270:print"is this correct? (y or n)"
  25. 250 gosub 330:if a$ <> "y" then 190
  26. 260 return
  27. 270 for i=0to5:if xm$(dt+j,i)="" then xm$(dt+j,i)=s$
  28. 280 print i+1 spc(1) chr$(18) xm$(dt+j,i):next:return
  29. 290 :
  30. 300 print"enter memo date  1 -"nd(mo):input dt
  31. 310 if dt <1 or dt >nd(mo) then print"[145][145][145]":goto 300
  32. 320 mm(dt)=1:return
  33. 330 :
  34. 340 a$="":get a$:if a$="" then 330
  35. 350 return
  36. 360 :
  37. 370 rem ------ cancel memo ------
  38. 380 gosub 300:mm(dt)=0:for i=0to5
  39. 390 xm$(dt+j,i)=s$:next
  40. 400 return
  41. 410 :
  42. 420 rem ------ print calendar ------
  43. 430 print"[147] turn on printer":print"ready? (y or n)"
  44. 440 gosub 330:if a$ <> "y" then return
  45. 450 close 4:open 4,4:c=0:c1=1:n=0
  46. 460 l=len(mo$(mo))/2:print#4,chr$(14) spc(16-l) mo$(mo)" -" yr
  47. 470 print#4,chr$(13) chr$(13) chr$(14)left$(pd$,39):print#4,chr$(15):print#4,h$
  48. 480 for i=1toy:for t=0to6:c=c+1
  49. 490 if c=<j or n=>nd(mo) then print#4,us$;:goto 520
  50. 500 n=n+1:n$=" "+mid$(str$(n),2)
  51. 510 print#4,left$(us$,7)chr$(14)right$(n$,2)chr$(15);
  52. 520 next t:print#4,u$
  53. 530 for t1=0to5:for t2=0to6
  54. 540 if xm$(c1+t2,t1)=""then print#4,us$;:goto560
  55. 550 print#4,u$+xm$(c1+t2,t1);
  56. 560 next t2:print#4,u$:next t1:c1=c1+7:print#4,h$
  57. 570 next i:print#4:close 4:return
  58. 580 :
  59. 590 rem ------ gregorian date ------
  60. 600 input"enter month (1-12)";mo:if mo <1 or mo>12 then print"[145][145]":goto600
  61. 610 input"enter  year (yyyy)";yr:if yr <1583 then print"[145][145]":goto610
  62. 620 q=yr+(mo<3):j=int(275*mo/9)-int((7*q+7)/4)+367*yr+1-int((int(q/100)+1)*3/4)
  63. 630 j=j-4-7*int((j-4)/7):x=(nd(mo)+j)/7:y=int(x):if x>y then y=y+1
  64. 640 if(yr/100)-int(yr/100)=0 and (yr/400)-int(yr/400)<>0 then return
  65. 650 if (yr/4)-int(yr/4)=0 and mo=2 then nd(mo)=29
  66. 660 return
  67. 670 :
  68. 680 rem ----- print screen -----
  69. 690 l=len(mo$(mo))/2:print"[147]"spc(16-l) mo$(mo)" -" yr
  70. 700 print:print spc(3) dy$:print:c=0:n=0
  71. 710 for i=1toy:for t=1to7:c=c+1:if c=<j then print spc(5):goto 750
  72. 720 if n=>nd(mo) then 750
  73. 730 n=n+1:n$=" "+mid$(str$(n),2):if mm(n) then print chr$(18);
  74. 740 print spc(3) right$(n$,2) chr$(146);
  75. 750 next t:print:print:next i
  76. 760 print"1. edit a memo":print"2. cancel memo":print"3. print calendar"
  77. 770 print"4. new calendar":print"5. quit"
  78. 780 print"select (1-5)":return
  79. 790 :
  80. 800 data january,31,february,28,march,31,april,30,may,31,june,30,july,31
  81. 810 data august,31,september,30,october,31,november,30,december,31
  82. 820 data sun,mon,tue,wed,thu,fri,sat
  83.